
public class Java_4 {
	public static void main(String[] args) {
		long aa = System.nanoTime();
		StringBuffer b = new StringBuffer();
		for (int i = 0; i < 10000; i++) {
			b.append("aa");
		}
		long aaa = System.nanoTime() - aa;
		System.out.println(aaa);
		long bb = System.nanoTime();
		StringBuilder a = new StringBuilder();
		for (int i = 0; i < 10000; i++) {
			a.append("bb");
		}
		long bbb = System.nanoTime() - bb;
		System.out.println(bbb);
		if (aaa < bbb) {
			System.out.println("StringBuffer");
		} else {
			System.out.println("StringBuilder");
		}
	}
}
